package spring.demo8.bean;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;


public class SutdentsRowMapper implements RowMapper<StudentsBean> {

	@Override
	public StudentsBean mapRow(ResultSet rs, int rowNum) throws SQLException {
		StudentsBean bean = new StudentsBean();
		bean.setId(rs.getInt("stu_id"));
		bean.setName(rs.getString("stu_name"));
		bean.setAge(rs.getInt("stu_age"));
		bean.setGengder(rs.getInt("stu_gender"));
		
		return bean;
	}

}
